package com.xbjtech.service;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import com.xbjtech.mapper.OrderMapper;
import com.xbjtech.model.Order;

@Service
public class OrderService extends BaseService<Order> {
	
	@Autowired
	OrderMapper orderMapper;
	
	@Transactional
	public void insertOrders(List<Order> orders) {
		// 最好使用批处理方式来做， 参看之前批处理的代码
		for (Order o : orders) {
			orderMapper.insertUseGeneratedKeys(o);
		}
	}

}
